In [1]:
import pandas as pd
import plotly.express as px
In [2]:
lib_names = ['Blosc2 (NDArray)', 'Zarr (Blosc1)', 'h5py (HDF5 - Blosc1)', 'h5py (HDF5 - Blosc2)']
creation_time_min = [56.15, 60, 45.74, 35.09]
In [3]:
fig = px.bar(y=creation_time_min, x=lib_names, color=lib_names, 
             labels = {'x': '', 'y': '', 'color': ''})
fig.update_layout(title_text='File creation time (minutes)', title_x=0.45)
fig.show()
In [4]:
sizesGB = [12.67, 32.15, 32.1, 12.3]
fig = px.bar(y=sizesGB, x=lib_names, color=lib_names, labels = {'x': '', 'y': '', 'color': ''})
fig.update_layout(title_text='File size of 3D array (GB)', title_x=0.45)
fig.show()
In [5]:
axis = [0, 1, 2] * 4
libraries = [lib_names[0]] * 3 + [lib_names[1]] * 3 + [lib_names[2]] * 3 + [lib_names[3]] * 3
In [6]:
speed1 = [3.27, 3.75, 3.9,
         1.68, 1.73, 1.70,
          1.73, 1.76, 1.72,
         1.76, 1.8, 1.82]

# nthreads = 1
df1 = pd.DataFrame()
df1.insert(0, 'Speed (GB/s)', speed1)
df1.insert(1, 'Axis', axis)
df1.insert(2, 'Library', libraries)
df1.insert(3, 'nthreads', [1] * len(speed1))

# nthreads = 16
speed16 = [3.78, 4.36, 4.28,
          3.32, 3.5, 3.4,
           3.57, 3.66, 3.43,
          1.13, 1.15, 1.14]
df16 = pd.DataFrame()
df16.insert(0, 'Speed (GB/s)', speed16)
df16.insert(1, 'Axis', axis)
df16.insert(2, 'Library', libraries)
df16.insert(3, 'nthreads', [16] * len(speed1))
In [7]:
df = pd.concat([df1, df16], axis=0)
df.reset_index(drop=True)

fig = px.bar(df, x='Axis', y='Speed (GB/s)', color='Library', barmode = 'group', facet_col="nthreads",
            labels = {'Library': ''})
fig.update_layout(title_text='Slicing speed along different axis (GB/s)', title_x=0.45)
fig.show()
In [8]:
# Without specifying nthreads
speed = [3.85, 4.88, 4.98,
        4.04, 4.24, 4.18,
         1.7, 1.72, 1.73,
        1.76, 1.8, 1.81]
df_def = pd.DataFrame()
df_def.insert(0, 'Speed (GB/s)', speed)
df_def.insert(1, 'Axis', axis)
df_def.insert(2, 'Library', libraries)
df_def.insert(3, 'nthreads', ['Default'] * len(libraries))


df2 = pd.concat([df, df_def], axis=0)
df2.reset_index(drop=True)

fig = px.bar(df2, x='Axis', y='Speed (GB/s)', color='Library', barmode = 'group', facet_col="nthreads",
            labels = {'Library': ''})
fig.update_layout(title_text='Slicing speed along different axis (GB/s)', title_x=0.45)
fig.show()
In [ ]: